#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
    int z = 0;
    scanf("%d", &z);
    int f1 = z / 60;
    int s = z / 60 / 60;
    int f = f1 % 60;
    int m = z % 60;
    printf("%d %d %d", s, f, m);
    return 0;
}